package mao.exaimnation.vivo;

import java.util.Scanner;

/**
 * @author Totoro
 * @date 2020/9/12
 * @explain:
 */
public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            String s = scanner.nextLine();
            char[] chars = s.toCharArray();
            int left = 0,right = chars.length-1;
            boolean deleted = false;
            boolean flag = true;
            while (left < right){
                if (chars[left] == chars[right]){
                    left++;
                    right--;
                }else if (deleted){
                    flag = false;
                    System.out.println(false);
                }else{
                        if (chars[left+1] == chars[right]){
                            chars[left] = '$';
                            left++;
                            deleted = true;
                        }else if (chars[left] == chars[right-1]) {
                            chars[right] = '$';
                            right--;
                            deleted = true;
                        }else {
                            flag = false;
                            System.out.println(false);
                        }
                }
            }
            if (flag){
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < chars.length; i++) {
                    if (chars[i] != '$') {
                        builder.append(chars[i]);
                    }
                }
                System.out.println(builder.toString());
            }

        }
    }
}
